home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / vbcc / doc / vc.doc < prev    next >
Text File  |  1998-06-24  |  7KB  |  177 lines

  1. vc - frontend for vbcc (c) in 1995-97 by Volker Barthelmann
  2.  
  3.  
  4. INTRODUCTION
  5.  
  6.     vc calls the preprocessor, compiler, assembler and linker.
  7.     It should be somewhat Unix cc compatible.
  8.  
  9.  
  10. LEGAL
  11.  
  12.     vc is (c) in 1995-97 by Volker Barthelmann. All code is written by me
  13.     and may be freely redistributed as long as no modifications are made
  14.     and nothing is charged for it.
  15.  
  16.  
  17. INSTALLATION
  18.  
  19.     This may change in following versions.
  20.  
  21.     First do not set your stack too low (if your operating systems needs
  22.     specifying a stack size). I have not tested how much stack vbcc needs,
  23.     some 10k will probably be enough.
  24.  
  25.     At the moment vc calls an external preprocessor, so this one must be
  26.     in the path and you probably have to tell the preprocessor the
  27.     directories that contain the vbcc includes (and any os includes, if you
  28.     have them).
  29.  
  30.     vc needs a config file which tells it how to call all the translation
  31.     phases (preprocessor, compiler, assembler, linker). The locations where
  32.     vc searches for config files depend on how it was compiled.
  33.     On the Amiga it will usually search for "vc.config" in the current
  34.     directory, then in ENV: and VBCC:.
  35.     On Unix it will search for vc.config in the current directory followed
  36.     by /etc/vc.config.
  37.     Those locations can be changed by modifying config_names in vc.c and
  38.     rebuilding it.
  39.  
  40.     The following options can be used to tell vc how to call the translation
  41.     phases (they will usually be contained in the config-file):
  42.  
  43.     -pp=string  The preprocessor will be called like in
  44.                 printf(string,opts,infile,outfile), e.g. the default for vcpp
  45.                 searching the includes in vinclude: and defining __STDC__)
  46.                 is "-pp=vcpp -Ivinclude: -D__STDC__=1 %s %s %s"
  47.  
  48.     -cc=string  For the compiler. Will be called like in
  49.                 printf(string,infile,outfile,options,optimization), e.g.
  50.                 "-cc=vbccm68k -quiet %s -o= %s %s -O=%d"
  51.  
  52.     -as=string  The same for the assembler, E.g.:
  53.                 "-as=PhxAss opt NRQBTLPSM quiet %s to %s" or
  54.                 "-as=as %s -o %s"
  55.  
  56.     -rm=string  This is the string for the delete command and takes only
  57.                 one argument, e.g.
  58.                 "-rm=delete quiet %s" or
  59.                 "-rm=rm %s"
  60.  
  61.     -ld=string  This is for the linker and takes three arguments. The first
  62.                 one are the object files (separated by spaces), the second
  63.                 one the user specified libraries and the last one the name
  64.                 of the resulting executable.
  65.                 This has to link with proper startup-code and c-libraries,
  66.                 e.g.:
  67.                 "-ld=PhxLnk vlib:startup.o %s %s vlib:vc.lib vlib:amiga.lib
  68.                  to %s" or
  69.                 "-ld=ld /usr/lib/crt0.o %s %s -lc -o %s"
  70.  
  71.     -l2=string  The same like -ld, but standard-startup and -libraries should
  72.                 not be linked; used when -nostdlib is specified.
  73.  
  74.     All those strings should tell the command to omit any output apart from
  75.     error messages if possible. However for every of those options there
  76.     exists one with an additional 'v', i.e. -ppv=, -asv=, etc. which should
  77.     produce some output, if possible.
  78.     If vc is invoked with the -vv option the verbose commands will be called,
  79.     if not the quiet ones will be used.
  80.  
  81.     -ul=string  Format for additional libraries specified with -l<lib>.
  82.                 The result of printf(string,lib) will be added to the
  83.                 command invoking the linker. Examples are:
  84.                 "-ul=vlib:%s.lib" or "-ul=-l%s"
  85.  
  86.     -ml=n       If the linker line is longer than <n> characters the objects
  87.                 will be written to a temporary file and passed to the linker
  88.                 with @tmpfile. This will not work with all linkers.
  89.  
  90.  
  91. CONFIG
  92.  
  93.     vc looks for a config file named 'vc.config' in the current directory
  94.     first and then in some other places which have been specified
  95.     while compiling vc (on the Amiga this will be ENV:vc.config then
  96.     VBCC:vc.config; on Unix systems /etc/vc.config). If it is found it will
  97.     be treated as a collection of additional command line arguments. Every
  98.     line of the file will be used as one argument. So no quoting shall be
  99.     used and furthermore must each argument be placed on its own line.
  100.     There should be an example vc.config.
  101.  
  102.     If one option '+file' is specified then <file> will be used as
  103.     config-file (it will be searched in the same directories as the
  104.     default config-files). Only the first such option will be used.
  105.  
  106.  
  107. USAGE
  108.  
  109.     vc [options] file1 file2 ...
  110.  
  111.     Processes all files according to their suffix and links all objects
  112.     together (unless any of -E, -S, -c is specified). It recognizes the
  113.     following file types:
  114.  
  115.     .c      C source
  116.     .i      already preprocessed C source
  117.     .asm
  118.     .s      assembler source
  119.     .obj
  120.     .o      object file
  121.  
  122.     Usually pattern matching is supported - however this depends on the
  123.     port and the host system.
  124.  
  125.     The options recognized by vc are:
  126.  
  127.     -v      verbose; print all commands
  128.  
  129.     -vv     very verbose; display some internals, aswell
  130.  
  131.     -Ox     optimization level
  132.             -O0 is equivalent to -O=0
  133.             -O  will activate some optimizations (at the moment -O=991)
  134.             -O2 will activate most optimizations (at the moment -O=1023)
  135.             -O3 will activate all  optimizations (at the moment -O=~0)
  136.  
  137.             Higher values may or may not activate even more optimizations.
  138.             The default is -O=1.
  139.             It is also possible to specify an exact value with -O=n.
  140.             However, I do not recommend this unless you know exactly what
  141.             you are doing.
  142.  
  143.     -o file save target as file (default for executables is a.out)
  144.  
  145.     -E      do not compile, save the preprocessed C sources with .i suffix
  146.  
  147.     -S      do not assemble, save the compiled files with .asm suffix
  148.  
  149.     -c      do not link, save the compiled files with .o suffix
  150.  
  151.     -k      keep all intermediate files; by default all generated files
  152.             except the source files and the targets are deleted
  153.  
  154.     -Dstr   #define a preprocessor symbol, e.g. -DAMIGA or -DCPU=68000;
  155.             at the moment this is passed through to the preprocessor
  156.  
  157.     -Ipath  add path to the include-search-path;
  158.             at the moment this is passed through to the preprocessor
  159.  
  160.     -lulib  link with library ulib
  161.  
  162.     -+      allow C++ comments
  163.  
  164.     -nostdlib   do not link with standard-startup/libraries; useful only
  165.                 for people who know what they are doing
  166.  
  167.     -notmpfile  do not use names from tmpnam() for temporary files
  168.  
  169.     +file   use file as config-file
  170.  
  171.  
  172.     All other options are passed through to vbcc.
  173.  
  174.  
  175. Volker                                                  volker@vb.franken.de
  176.  
  177.